<template>
  <div>
    <x-header id="header" :left-options="{backText: ''}">客户经理</x-header>
    <div class="manager-main main-header">
      <div class="manager">
        <div class="name" >
          <div class="head">
            <img class="icon" src="../../../static/img/user.png" />
            <div class="title">客户经理</div>
          </div>
          <div class="content">{{detail.managerName || '暂无'}}</div>
        </div>
        <div class="mobile" >
          <div class="head">
            <img class="icon" src="../../../static/img/phone2.png"/>
            <div class="title">联系电话</div>
          </div>
          <div class="content">{{detail.managerMobile || '暂无'}}</div>
        </div>
        <div class="save">
          <x-button class="save-button" @click.native="link">联系客户经理</x-button>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { getUserDetail } from '@/api/user'
export default {
  name: 'manager',
  data () {
    return {
      detail:{}
    }
  },
  methods:{
    link() {
      if (this.detail.managerMobile) {
        window.location.href=`tel:${this.detail.managerMobile}`
      } else {
        this.$vux.toast.text('您暂无客户经理或客户经理暂无联系方式')
      }

    }
  },
  mounted () {
    getUserDetail(this.globalData.cid).then( data => {
      this.detail = data
    })
  }
}
</script>

<style scoped>

</style>
